<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var returnMessage ="{\n" +
        "        \"is_menu_open\": 1,\n" +
        "        \"selfmenu_info\": {\n" +
        "        \"button\": [\n" +
        "            {\n" +
        "                \"type\": \"click\",\n" +
        "                \"name\": \"今日歌曲\",\n" +
        "                \"key\": \"V1001_TODAY_MUSIC\"\n" +
        "            },\n" +
        "            {\n" +
        "                \"name\": \"菜单\",\n" +
        "                \"sub_button\": {\n" +
        "                    \"list\": [\n" +
        "                        {\n" +
        "                            \"type\": \"view\",\n" +
        "                            \"name\": \"搜索\",\n" +
        "                            \"url\": \"http://www.soso.com/\"\n" +
        "                        },\n" +
        "                        {\n" +
        "                            \"type\": \"view\",\n" +
        "                            \"name\": \"视频\",\n" +
        "                            \"url\": \"http://v.qq.com/\"\n" +
        "                        },\n" +
        "                        {\n" +
        "                            \"type\": \"click\",\n" +
        "                            \"name\": \"赞一下我们\",\n" +
        "                            \"key\": \"V1001_GOOD\"\n" +
        "                        }\n" +
        "                    ]\n" +
        "                }\n" +
        "            }\n" +
        "        ]\n" +
        "    }\n" +
        "    }";
    let jsonObject = JSON.parse(returnMessage);
    console.log(jsonObject);
    console.log("is_menu_open = " + jsonObject.is_menu_open);
    console.log("type = " +jsonObject.selfmenu_info.button[0].type);
    console.log("name = " +jsonObject.selfmenu_info.button[0].name);
    console.log("key = " +jsonObject.selfmenu_info.button[0].key);
    console.log("name = " +jsonObject.selfmenu_info.button[1].name);
    console.log("type = " +jsonObject.selfmenu_info.button[1].sub_button.list[0].type);
    console.log("name = " +jsonObject.selfmenu_info.button[1].sub_button.list[0].name);
    console.log("url = " +jsonObject.selfmenu_info.button[1].sub_button.list[0].url);
    console.log("type = " +jsonObject.selfmenu_info.button[1].sub_button.list[1].type);
    console.log("name = " +jsonObject.selfmenu_info.button[1].sub_button.list[1].name);
    console.log("url = " +jsonObject.selfmenu_info.button[1].sub_button.list[1].url);
    console.log("type = " +jsonObject.selfmenu_info.button[1].sub_button.list[2].type);
    console.log("name = " +jsonObject.selfmenu_info.button[1].sub_button.list[2].name);
    console.log("key = " +jsonObject.selfmenu_info.button[1].sub_button.list[2].key);
</script>
</body>
</html>